import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from './../pages/Home/Home'
import Chat from './../pages/Chat/Chat'
import Me from './../pages/Me/Me'
import Search from './../pages/Search/Search'
import Recommend from './../pages/Recommend/Recommend'

//声明使用
Vue.use(VueRouter);

//输出对象
export default new VueRouter({
  //配置一级路由
  routes:[
    {
      path:'/',
      redirect:'/home'
    },
    {
      path:'/home',
      component:Home,
      children:[
        {path:'/home',redirect:'/home/hot'},
        {path:'hot',component:()=>import('./../pages/Home/Children/Hot.vue')},
        {path:'dress',component:()=>import('./../pages/Home/Children/Dress.vue')},
        {path:'box',component:()=>import('./../pages/Home/Children/Box.vue')},
        {path:'mbaby',component:()=>import('./../pages/Home/Children/Mbaby.vue')},
        {path:'general',component:()=>import('./../pages/Home/Children/General.vue')},
        {path:'food',component:()=>import('./../pages/Home/Children/Food.vue')},
        {path:'shirt',component:()=>import('./../pages/Home/Children/Shirt.vue')},
        {path:'man',component:()=>import('./../pages/Home/Children/Man.vue')},
        {path:'ele',component:()=>import('./../pages/Home/Children/Ele.vue')}
      ]
    },
    {
      path:'/chat',
      component:Chat
    },
    {
      path:'/me',
      component:Me
    },
    {
      path:'/search',
      component:Search
    },
    {
      path:'/recommend',
      component:Recommend
    }
  ]
})
